/*
 * Copyright 2002-2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.beans.factory;

import org.springframework.lang.Nullable;

/**
 * HierarchicalBeanFactory 提供父容器的访问功能.至于父容器的设置,需要找ConfigurableBeanFactory的setParentBeanFactory(接口把设置跟获取给拆开了!).
 * <p>
 * 总结：这个工厂接口非常简单，实现了Bean工厂的分层。这个工厂接口也是继承自BeanFactory，扩展了父类容器的方法，比如对父容器的获取
 * 也是一个二级接口，相对于父接口，它只扩展了一个重要的功能——工厂分层。
 *
 * @author Rod Johnson
 * @author Juergen Hoeller
 * @see org.springframework.beans.factory.config.ConfigurableBeanFactory#setParentBeanFactory
 * @since 07.07.2003
 */
public interface HierarchicalBeanFactory extends BeanFactory {

	/**
	 * 获取父容器，跟BeanFactory一样，只有get没有put的操作，可见在spring中，获取与设置是分开的。
	 */
	@Nullable
	BeanFactory getParentBeanFactory( );

	/**
	 * 判断本地工厂是否包含这个Bean（忽略其他所有父工厂）。这也是分层思想的体现
	 */
	boolean containsLocalBean(String name);

}
